<template>
	<view>
		<NavBar text='转诊' @end='end'>
			<template slot='title' v-if="isxian">
				<!-- <u-icon name='list' size='28rpx' color="#fff"></u-icon> -->
				<view style="color: #fff; font-size: 25rpx;">发起申请</view>
			</template>
		</NavBar>
		<view style="width: 100%; height: 123rpx;"></view>
		<view class="zzstyle" v-for="(item,index) in array" :key="index">
			<view style="width: 90%; margin:0 auto; margin-top:20rpx;" @click="isindex == 1 ? zzxx(item.status, item) : ''">
				<view style="width: 100%; height: 20rpx;"></view>
				<view class="zzstyle_">
					<view class="flx">
						<view class="flx1">
							<view class="zzstyle_text">{{item.name}}</view>
							<view  class="zzstyle_text_">{{item.sex}}</view>
							<view  class="zzstyle_text_1">{{item.age}}岁</view>
							<view  class="zzstyle_text_2">{{item.ks}}</view>
						</view>
						<view class="zzstyle_right">
							{{item.status == 0 ? '待接受' : '已完成'}}
						</view>
					</view>
					<view class="c-zzstyle flx1">
						<view>疾病初诊断：</view>
						<view>{{item.bz}}</view>
					</view>
				</view>
				<view class="b-zzstyle">{{item.date}}</view>
				<view style="width: 100%; height: 20rpx;"></view>
			</view>
		</view>
		<view style="width: 100%; height: 200rpx;"></view>
	</view>
</template>

<script>
	import NavBar from '@/components/NarBar.vue'
	export default {
		components: {
			NavBar
		},
		data(){
			return{
				isxian: true,
				isindex:0,
				array:[
					{
						name:'张三三',
						sex:'女',
						age:'23',
						ks:'内科',
						bz:'斑疹伤寒',
						date:'2023-03-22 12: 22',
						status:0,
					},					
					{
						name:'张大',
						sex:'男',
						age:'23',
						ks:'内科',
						bz:'带状疱疹',
						date:'2023-03-21 10: 22',
						status:0,
					},
					{
						name:'李四',
						sex:'女',
						age:'21',
						ks:'外科',
						bz:'骨折',
						date:'2023-03-21 12: 22',
						status:0,
					},
					{
						name:'张飒',
						sex:'女',
						age:'23',
						ks:'外科',
						bz:'烫伤',
						date:'2023-03-22 17: 02',
						status:0,
					},
					{
						name:'李五',
						sex:'女',
						age:'23',
						ks:'内科',
						bz:'扁桃体发炎',
						date:'2023-03-01 07: 55',
						status:0,
					},
					{
						name:'张万',
						sex:'女',
						age:'23',
						ks:'外科',
						bz:'骨折错位',
						date:'2022-03-25 10: 01',
						status:0,
					},
					{
						name:'张三三',
						sex:'女',
						age:'23',
						ks:'内科',
						bz:'斑疹伤寒',
						date:'2021-02-23 08: 08',
						status:0,
					},
					{
						name:'张问问',
						sex:'女',
						age:'23',
						ks:'内科',
						bz:'湿寒症',
						date:'2019-02-04 07: 00',
						status:1,
					}
				]
			}
		},
		onLoad(e){
			this.isindex = e.index
			if(e.index == 1){
				this.isxian = false
			}
		},
		methods:{
			end(){
				uni.navigateTo({
					url:'/pages/twowayReferral/Referralrequest'
				})
			},
			zzxx(e, item){
				console.log(item);
				uni.navigateTo({
					url:'/pages/twowayReferral/Referralrequest?status=' + e + '&datas=' + JSON.stringify(item)
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f7f7f7;
	}
	.zzstyle{
		background-color: #fff;
		.zzstyle_{
			.zzstyle_text{font-size: 30rpx; color: #333; line-height: 60rpx;}
			.zzstyle_text_{
				font-size: 28rpx;
				color: #a6a6a6; 
				line-height: 60rpx;
				margin-left:20rpx;
			}
			.zzstyle_text_1{
				font-size: 28rpx;
				color: #a6a6a6; 
				line-height: 60rpx;
				margin-left:10rpx;
			}
			.zzstyle_text_2{
				font-size: 28rpx;
				color: #a6a6a6; 
				line-height: 60rpx;
				margin-left:30rpx;
			}
			.zzstyle_right{
				font-size: 28rpx;
				color: #0066ff; 
				line-height: 60rpx;
			}
		}
		.c-zzstyle{
			line-height: 50rpx;
			font-size: 28rpx;
			color: #a6a6a6;
		}
		.b-zzstyle{
			text-align: end;
			font-size: 28rpx;
			color: #a6a6a6;
		}
	}
</style>